﻿@using SCMS.Resources
@model SCMS.UI.Models.ViewGeneralInventoty
<div class="partialViewCard">
    <div class="partialViewCardHeader">
        <h3>@Resources_frank.Inventory_Index_ViewGeneralInventory</h3>
    </div>
    <br />
    @if (Model.EntityInventory.Count() > 0)
    {
     
        
        <input type="hidden" id="actionStatus" value="@ViewBag.Response" />
        <input type="hidden" id="statusMsg" value="@ViewBag.msg" />
           
        <div id="tablewrapper">
            <div id="tableheader">
                <div class="search">
                    <b>@Resources_frank.Global_String_SearchBy:</b><br />
                    <select id="columns" onchange="sorter.search('query')">
                    </select>
                    <input type="text" id="query" onkeyup="sorter.search('query')" />
                </div>
                <span class="details">
                    <div>
                        @Resources_frank.Global_String_Records <span id="startrecord"></span>-<span id="endrecord"></span> @Resources_frank.Global_String_Of <span id="totalrecords">
                        </span>
                    </div>
                </span>
            </div>
            <br />
            <br />
            <br />
            <table width="98%" align="center" cellpadding="0" cellspacing="0" border="0" id="table"
                class="tinytable">
                <thead>
                    <tr class="gridheader">
                        <th align="center">
                            <h3>
                                #</h3>
                        </th>
                        <th align="center">
                            <h3>
                                @Resources_frank.Global_String_Classification</h3>
                        </th>
                        <th>
                            <h3>
                                @Resources_morgan.Global_String_ItemName</h3>
                        </th>
                        <th>
                            <h3>
                                @Resources_frank.Global_String_Category</h3>
                        </th>
                        <th>
                            <h3>
                                @Resources_frank.Global_String_Qty</h3>
                        </th>
                    </tr>
                </thead>
                <tbody>
                    @{int count = 0;}
                    @foreach (var item in Model.EntityInventory)
                    {
                        count = count + 1;
                        if (item.Item.ItemCategory.CategoryCode == "A")
                        { <tr class="gridodd" style="cursor: pointer;" onclick="sendAjaxRequest('/Inventory/GeneralInventoryPopUp?itemId=@item.ItemId','@Resources_frank.Global_String_AssetList')">
                            <td align="center" style="width: 10%;">
                                @count
                            </td>
                            <td align="left" style="width: 20%;">
                                @item.Item.ItemClassification.Name
                            </td>
                            <td align="left" style="width: 30%;">
                                @item.Item.Name
                            </td>
                            <td align="left" style="width: 20%;">
                                @item.Item.ItemCategory.CategoryName
                            </td>
                            <td align="left" style="width: 20%;">
                                @item.Quantity
                            </td>
                        </tr>}
                        else
                        {<tr class="gridodd" style="cursor: pointer;" onclick="sendAjaxRequest('/Inventory/ConsumableInventoryPopUp?itemId=@item.ItemId','@Resources_frank.Global_String_ConsumableList')">
                            <td align="center" style="width: 10%;">
                                @count
                            </td>
                            <td align="left" style="width: 20%;">
                                @item.Item.ItemClassification.Name
                            </td>
                            <td align="left" style="width: 30%;">
                                @item.Item.Name
                            </td>
                            <td align="left" style="width: 20%;">
                                @item.Item.ItemCategory.CategoryName
                            </td>
                            <td align="left" style="width: 20%;">
                                @item.Quantity
                            </td>
                        </tr> }
                    }
                </tbody>
            </table>
            <div id="tablefooter">
                <div id="tablenav">
                    <div>
                        <img src="../../Content/images/pager/first.gif" width="16" height="16" alt="@Resources_frank.Global_String_FirstPage"
                            onclick="sorter.move(-1,true)" />
                        <img src="../../Content/images/pager/previous.gif" width="16" height="16" alt="@Resources_frank.Global_String_PreviousPage"
                            onclick="sorter.move(-1)" />
                        <img src="../../Content/images/pager/next.gif" width="16" height="16" alt="@Resources_frank.Global_String_NextPage"
                            onclick="sorter.move(1)" />
                        <img src="../../Content/images/pager/last.gif" width="16" height="16" alt="@Resources_frank.Global_String_LastPage"
                            onclick="sorter.move(1,true)" />
                    </div>
                    <div>
                        <select id="pagedropdown">
                        </select>
                    </div>
                    <div>
                        <a href="javascript:sorter.showall()">@Resources_frank.Global_String_ViewAll</a>
                    </div>
                </div>
                <div id="tablelocation">
                    <div>
                        <select onchange="sorter.size(this.value)">
                            <option value="5">5</option>
                            <option value="10">10</option>
                            <option value="20" selected="selected">20</option>
                            <option value="50">50</option>
                            <option value="100">100</option>
                        </select>
                        <span>@Resources_frank.Global_String_EntriesPerPage</span>
                    </div>
                    <div class="page">
                        @Resources_frank.Global_String_Page <span id="currentpage"></span>@Resources_frank.Global_String_Of <span id="totalpages"></span>
                    </div>
                </div>
            </div>
        </div>
        
        
    }
    @if (Model.EntityInventory.Count() < 1)
    {
        <div>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <i>@Resources_frank.Inventory_ViewGeneralInventory_NoItems</i>
        </div>
        
    }
    <br />
</div>
